package com.kkwrite.regimen.provider.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.kkwrite.regimen.provider.domain.RegShopDO;

/** 
 * 类说明 
 *
 * @author Soosky Wang
 * @date 2018年7月21日 上午9:52:02 
 * @version 1.0.0
 */
public interface RegShopRepository extends JpaRepository<RegShopDO, Long> {
	
	@Query(value = "select * from reg_shop where shop_id = :shopId and city = :city and shop_keywords like %:shopKeywords%", nativeQuery=true)
	RegShopDO findByShopIdAndShopKeywordsLike(@Param("shopId") Long shopId, @Param("shopKeywords") String shopKeywords,@Param("city") String city);
	
	@Query(value = "select count(*) from reg_shop", nativeQuery=true)
	int getShopCount();
	
	/*
	 * RegShopDO findByShopIdAndShopKeywordsLike(Long shopId, String shopKeywords);
	 */
}
